package org.joa.actor.transaction;

import java.util.concurrent.Callable;

import org.joa.actor.ActorName;
import org.joa.manager.ActorManager;

public class TransactionProxy {
    public static Transaction create(ActorName owner, Callable<?> retryCallable) {
        TransactionActor transactionActor = new TransactionActor(retryCallable);
        ActorManager.instance.register(transactionActor);

        return (Transaction) ActorManager.instance.createActorProxy(
            transactionActor.self(),
            owner,
            Transaction.class);
    }
}
